﻿@model HCQ2_Model.T_Role
@{
    ViewBag.Title = "角色管理";
}
@section headerSection{

    <style>
        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-left: 5px;
        }
    </style>
}
<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins" style="margin-bottom: 0px;">
        <div class="ibox-content" style="padding: 5px 20px 0px 20px;">
            <div class="row row-lg">
                <div class="col-sm-12 col-sm-leftRight">
                    <!-- Example Toolbar -->
                    <div class="example">
                        <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                            @{
                                List<string> folderList = (List<string>)ViewBag.elementList;
                                if (folderList.Contains("roleDetail"))
                                {
                                    <button id="roleDetail" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-th-large" aria-hidden="true">详细</i>
                                    </button>
                                }
                                if (folderList.Contains("roleAdd"))
                                {
                                    <button id="roleAdd" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true">新增</i>
                                    </button>
                                }
                                if (folderList.Contains("roleEdit"))
                                {
                                    <button id="roleEdit" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑</i>
                                    </button>
                                }
                                if (folderList.Contains("roleDel"))
                                {
                                    <button id="roleDel" type="button" class="btn btn-outline btn-danger">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true">删除</i>
                                    </button>
                                }
                                if (folderList.Contains("btnSearch"))
                                {
                                    <div class="form-group">
                                        <input id="roleName" name="roleName" type="text" class="form-control" placeholder="请输入角色名称">
                                    </div>
                                    <div class="form-group" style="margin-top:-2px;width:150px;">
                                        <select id="smCode" name="smCode" title="请选择所属模块" class="form-control show-tick selectpicker" placeholder="请选择所属模块"></select>
                                    </div>
                                    <div class="form-group">
                                        <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                                    </div>
                                }
                                if (folderList.Contains("btnLimit"))
                                {
                                    <div class="form-group">
                                        <button id="btnLimit" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-leaf"></i>&nbsp;分配权限</button>
                                    </div>
                                }
                                if (folderList.Contains("btnGroup"))
                                {
                                    <div class="form-group">
                                        <button id="btnGroup" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-group"></i>&nbsp;分配组</button>
                                    </div>
                                }
                                if (folderList.Contains("btnJobUser"))
                                {
                                    <div class="form-group">
                                        <button id="btnJobUser" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-group"></i>&nbsp;批量分配用户</button>
                                    </div>
                                }
                            }
                        </div>
                        <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
                    </div>
                    <!-- End Example Toolbar -->
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!-- 添加/编辑 -->
<div id="roleForm" style="width: 430px;height:100%; overflow: hidden; display: none;">
    <form class="form-horizontal m-t" id="roleFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">角色名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="role_name" name="role_name" type="text" class="form-control input-sm" placeholder="请输入权限名称" title="请输入权限名称" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">角色代码<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="role_code" name="role_code" type="text" class="form-control input-sm" placeholder="请输入角色代码" title="请输入角色代码" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">所属模块<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=sm_code title="请选择所属模块" name="sm_code" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择所属模块"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">是否默认角色<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=default_role title="请选择所属模块" name="default_role" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择所属模块">
                    <option value="true">是</option>
                    <option value="false" selected>否</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">是否订阅角色<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=is_mark title="请选择是否订阅角色" name="is_mark" class="selectpicker show-tick bs-select-hidden" data-live-search="true" required="" aria-required="true" placeholder="请选择是否订阅角色">
                    <option value="1">是</option>
                    <option value="0" selected>否</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">备注：</label>
            <div class="col-sm-7">
                <textarea class="form-control" id="role_note" name="role_note" rows="3" placeholder="请输入备注信息" title="请输入备注信息"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-11 control-label" style="color:red;margin-left:50px;text-align:left;">温馨提示：添加角色时选成是默认角色，全员将默认拥有此角色！</label>
        </div>
    </form>
</div>
<!--组织机构用户设置-->
<div id="createDataBySel" style="width: 650px;overflow: hidden; display: none;">
    <div class="col-md-12 form-inline" style="padding:5px 15px;">
        <div class="form-group" style="margin-top:-6px;width:400px;">
            <select id="orgUnit" name="orgUnit" title="请选择所属单位" data-live-search="true" class="form-control input-sm selectpicker" placeholder="请选择所属单位" style="padding: 5px 10px;">
                <option value="" selected>全部</option>
            </select>
        </div>
        <div class="form-group" style="margin-top:1px;">
            <button id="btnRoleSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
        </div>
    </div>
    <div class="col-md-12">
        <select multiple="multiple" size="15" name="duallistbox_demo1" style="height: 250px;" class="demo1 listSel"></select>
    </div>
</div>
@section footSection{
    <script src="~/Resources/x-editable/js/bootstrap-editable.js"></script>
    <script src="~/Resources/duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <script src="~/Resources/myScript/SysAdmin/roleManager.js"></script>
    <script>
        $(function () {
            roleManager.initSelect();
            //初始化Table
            roleManager.initTable();
            //绑定事件
            roleManager.bindEvent();
        });
    </script>
}
